Page({
  data: {
    statusBarHeight: 0,
    list: [
      {id: 1, name: '吃饭'},
      {id: 2, name: '睡觉'},
      {id: 3, name: '打豆豆'},
    ]
  },
  onLoad() {
    const systemInfo = wx.getSystemInfoSync()
    console.log('systemInfo', systemInfo)
    const res = wx.getMenuButtonBoundingClientRect()
    console.log('clientRect', res)

    // 将 res.top 胶囊距离页面顶部的距离赋值给 statusBarHeight 
    this.setData({  statusBarHeight: res.top })
  }
})